import sdk from 'sdk'
import {encodeQuery} from 'utils/helper/query'

function getUrl(page, params) {
  let query = ''
  if (encodeQuery(params)) {
    query = '?' + encodeQuery(params)
  }
  let url = location.protocol + '//' + location.host + '/' + page + query
  return {url}
}
export default (page, params, type) => {
  sdk.openNewWebView(getUrl(page, params), type)
}

